<?php

/**
 *  后台操作员表表
 */

namespace app\admin\model;

use app\admin\model\BaseModel;

class Operator extends BaseModel
{

    protected $attributes = [
        'jobs' => [
            1 => 'Boss',
            10 => '运营主管',
            11 => '运营',
            12 => '客服',
            20 => '财务主管',
            21 => '财务',
            30 => '销售主管',
            31 => '销售',
            40 => '采购主管',
            41 => '采购',
            50 => '物流主管',
            51 => '物流',
            60 => '市场主管',
            61 => '市场',
            70 => '技术主管',
            71 => '技术',
        ]
    ];

    /**
     * @describe
     * @author: Bobo
     * @date: 2025-06-10 11:47:40 
     * @param [type] @required
     * @return Renderable
     */
    public function getAttributesMap()
    {
        return $this->attributes;
    }

    public function getFieldEnum($field = 'all')
    {
        return $this->getEnum(strtoupper($field), [], 'label');
    }


    // 定义关联方法
    public function department()
    {
        // 假设'department'是外键字段，'id'Department
        return $this->belongsTo('Department', 'department', 'id');
    }
}
